(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("jquery"),require("./util.js")):typeof define==="function"&&define.amd?define(["jquery","./util.js"],t):(e=e||self,e.Collapse=t(e.jQuery,e.Util))})(this,function(e,t){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function n(e,t,n){if(t)r(e.prototype,t);if(n)r(e,n);return e}function i(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){i(e,t,r[t])})}return e}var l="collapse";var s="4.3.1";var o="bs.collapse";var u="."+o;var f=".data-api";var c=e.fn[l];var g={toggle:true,parent:""};var h={toggle:"boolean",parent:"(string|element)"};var d={SHOW:"show"+u,SHOWN:"shown"+u,HIDE:"hide"+u,HIDDEN:"hidden"+u,CLICK_DATA_API:"click"+u+f};var _={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"};var m={WIDTH:"width",HEIGHT:"height"};var v={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'};var p=function(){function r(e,r){this._isTransitioning=false;this._element=e;this._config=this._getConfig(r);this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],'+('[data-toggle="collapse"][data-target="#'+e.id+'"]')));var n=[].slice.call(document.querySelectorAll(v.DATA_TOGGLE));for(var i=0,a=n.length;i<a;i++){var l=n[i];var s=t.getSelectorFromElement(l);var o=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});if(s!==null&&o.length>0){this._selector=s;this._triggerArray.push(l)}}this._parent=this._config.parent?this._getParent():null;if(!this._config.parent){this._addAriaAndCollapsedClass(this._element,this._triggerArray)}if(this._config.toggle){this.toggle()}}var i=r.prototype;i.toggle=function t(){if(e(this._element).hasClass(_.SHOW)){this.hide()}else{this.show()}};i.show=function n(){var i=this;if(this._isTransitioning||e(this._element).hasClass(_.SHOW)){return}var a;var l;if(this._parent){a=[].slice.call(this._parent.querySelectorAll(v.ACTIVES)).filter(function(e){if(typeof i._config.parent==="string"){return e.getAttribute("data-parent")===i._config.parent}return e.classList.contains(_.COLLAPSE)});if(a.length===0){a=null}}if(a){l=e(a).not(this._selector).data(o);if(l&&l._isTransitioning){return}}var s=e.Event(d.SHOW);e(this._element).trigger(s);if(s.isDefaultPrevented()){return}if(a){r._jQueryInterface.call(e(a).not(this._selector),"hide");if(!l){e(a).data(o,null)}}var u=this._getDimension();e(this._element).removeClass(_.COLLAPSE).addClass(_.COLLAPSING);this._element.style[u]=0;if(this._triggerArray.length){e(this._triggerArray).removeClass(_.COLLAPSED).attr("aria-expanded",true)}this.setTransitioning(true);var f=function t(){e(i._element).removeClass(_.COLLAPSING).addClass(_.COLLAPSE).addClass(_.SHOW);i._element.style[u]="";i.setTransitioning(false);e(i._element).trigger(d.SHOWN)};var c=u[0].toUpperCase()+u.slice(1);var g="scroll"+c;var h=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,f).emulateTransitionEnd(h);this._element.style[u]=this._element[g]+"px"};i.hide=function r(){var n=this;if(this._isTransitioning||!e(this._element).hasClass(_.SHOW)){return}var i=e.Event(d.HIDE);e(this._element).trigger(i);if(i.isDefaultPrevented()){return}var a=this._getDimension();this._element.style[a]=this._element.getBoundingClientRect()[a]+"px";t.reflow(this._element);e(this._element).addClass(_.COLLAPSING).removeClass(_.COLLAPSE).removeClass(_.SHOW);var l=this._triggerArray.length;if(l>0){for(var s=0;s<l;s++){var o=this._triggerArray[s];var u=t.getSelectorFromElement(o);if(u!==null){var f=e([].slice.call(document.querySelectorAll(u)));if(!f.hasClass(_.SHOW)){e(o).addClass(_.COLLAPSED).attr("aria-expanded",false)}}}}this.setTransitioning(true);var c=function t(){n.setTransitioning(false);e(n._element).removeClass(_.COLLAPSING).addClass(_.COLLAPSE).trigger(d.HIDDEN)};this._element.style[a]="";var g=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,c).emulateTransitionEnd(g)};i.setTransitioning=function e(t){this._isTransitioning=t};i.dispose=function t(){e.removeData(this._element,o);this._config=null;this._parent=null;this._element=null;this._triggerArray=null;this._isTransitioning=null};i._getConfig=function e(r){r=a({},g,r);r.toggle=Boolean(r.toggle);t.typeCheckConfig(l,r,h);return r};i._getDimension=function t(){var r=e(this._element).hasClass(m.WIDTH);return r?m.WIDTH:m.HEIGHT};i._getParent=function n(){var i=this;var a;if(t.isElement(this._config.parent)){a=this._config.parent;if(typeof this._config.parent.jquery!=="undefined"){a=this._config.parent[0]}}else{a=document.querySelector(this._config.parent)}var l='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';var s=[].slice.call(a.querySelectorAll(l));e(s).each(function(e,t){i._addAriaAndCollapsedClass(r._getTargetFromElement(t),[t])});return a};i._addAriaAndCollapsedClass=function t(r,n){var i=e(r).hasClass(_.SHOW);if(n.length){e(n).toggleClass(_.COLLAPSED,!i).attr("aria-expanded",i)}};r._getTargetFromElement=function e(r){var n=t.getSelectorFromElement(r);return n?document.querySelector(n):null};r._jQueryInterface=function t(n){return this.each(function(){var t=e(this);var i=t.data(o);var l=a({},g,t.data(),typeof n==="object"&&n?n:{});if(!i&&l.toggle&&/show|hide/.test(n)){l.toggle=false}if(!i){i=new r(this,l);t.data(o,i)}if(typeof n==="string"){if(typeof i[n]==="undefined"){throw new TypeError('No method named "'+n+'"')}i[n]()}})};n(r,null,[{key:"VERSION",get:function e(){return s}},{key:"Default",get:function e(){return g}}]);return r}();e(document).on(d.CLICK_DATA_API,v.DATA_TOGGLE,function(r){if(r.currentTarget.tagName==="A"){r.preventDefault()}var n=e(this);var i=t.getSelectorFromElement(this);var a=[].slice.call(document.querySelectorAll(i));e(a).each(function(){var t=e(this);var r=t.data(o);var i=r?"toggle":n.data();p._jQueryInterface.call(t,i)})});e.fn[l]=p._jQueryInterface;e.fn[l].Constructor=p;e.fn[l].noConflict=function(){e.fn[l]=c;return p._jQueryInterface};return p});
//# sourceMappingURL=collapse.map.js